[求源程序]VB的简易计算器求下载

来源:百度知道 编辑:UC知道 时间:2024/05/24 05:06:32
我需要一个可以用Visual Basic打开的简易计算器,能实现基本的加减乘除和清屏就够了,需要的是可以用vb编辑的那种。就是里面包含sln文件,还有一堆文件夹的那种,而不是什么exe文件。如果有的话请发给我地址,或者直接打包发到我的邮箱里面:cuichaocui@yahoo.com.cn,我收到之后会给你分数,我保证。
哪怕是你直接在网上找,找到之后发给我网址我都会给你分,只要符合我的要求,可以用vb打开。现在好多网上下载的都是exe文件,不是我要的那种。

Dim a As Double
Dim b As String
Private Sub Command1_Click(Index As Integer)
Text1.Text = Text1.Text & Command1(Index).Caption
End Sub

Private Sub Command2_Click()
If InStr(Text1.Text, ".") = 0 Then
Text1.Text = Text1.Text & Command2.Caption
End If
If Left(Text1.Text, 1) = "." Then
Text1.Text = "0" & Text1.Text
End If
End Sub
Private Sub Command3_Click()
If Text1.Text = "" Then
Text1.Text = a
Exit Sub
End If

Select Case b
Case "+"
a = a + Val(Text1.Text)
Case "-"
a = a - Val(Text1.Text)
Case "X"
a = a * Val(Text1.Text)
Case "÷"
If Text1.Text = "0" Then
Text1.Text = "0"
Else
a = a / Val(Text1.Text)
End If
End Select
Text1.Text = a
End